package com.zxy.supplier_system.server.controller

import com.zxy.supplier_system.server.entity.Authority
import com.zxy.supplier_system.server.service.MarketCheckInventoryRecordService
import com.zxy.supplier_system.server.utils.IntIdAndName
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PathVariable
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController

@RestController
@RequestMapping("markets/{id}/checkInventoryRecords")
class MarketsCheckInventoryRecordController(
    private val marketCheckInventoryRecordService: MarketCheckInventoryRecordService,
) {

    @HasAuthority(Authority.卖场_盘点_查询)
    @GetMapping("employees", params = ["projection=summary"])
    fun getMarketCheckInventoryRecordCreatedEmployeesByMarketId(@PathVariable id: Int): List<IntIdAndName> {
        return this.marketCheckInventoryRecordService.getMarketCheckInventoryRecordCreatedEmployeesByMarketId(id)
    }

}
